<template>
  <pdf-viewer v-if="!!store.pdfUrl && !!store.fileName" :url="store.pdfUrl" :fileName="store.fileName"
              @onPdfClose="back"></pdf-viewer>
</template>

<script>
import useGlobalStore from "../../store";

export default {
  name: "index",
  setup() {
    const store = useGlobalStore();
    return {store}
  },
  mounted() {
    if(!this.store.pdfUrl) {
      this.back();
    }
  },
  methods: {
    back() {
      this.$router.back();
    }
  }
}
</script>

<style scoped>

</style>
